package ro.dandanciu.webgallery.domainmodel;


public enum Languages {
	
	ENGLISH("en"),
	ROMANIAN("ro");
	private String code;
	private Languages(String code) {
		this.code = code;		
	}
	public String getCode(){
		return code;
	}
	public static Languages getByCode(String code) {
		for (Languages lang : Languages.values()) {
			if (lang.getCode().equals(code)) {
				return lang;
			}
		}
		return null;
	}
	
}
